import { Ajax } from './ajax.js';

// 服务器基础地址
const BASE_URL = 'https://service.huhuiyu.top/teach_project_service';
// token相关
const TOKEN_KEY = 'teach_project_token';

// 创建ajax实例(可以多个不同的ajax服务器)
let ajax1 = new Ajax(BASE_URL, TOKEN_KEY);

let server = {
  get: (url, params, callback) => {
    ajax1.send(url, params, callback, 'GET');
  },
  post: (url, params, callback) => {
    ajax1.send(url, params, callback, 'POST');
  },
};

export default server;
export { server as server };
